<!DOCTYPE html>
<html lang="en">
    <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta charset="utf-8">
		<meta http-equiv="cache-control" content="no-cache">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<title>户型简介 - 崇文金城</title>
		<link rel="stylesheet" type="text/css" href="./res/saved_resource">
        <link rel="stylesheet" type="text/css" href="style.css">
        <!--<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>-->
        <script src="show/jquery-1.7.2.min.js"></script>

	</head>

	<body>
        <div class="header xlkm-title xlkm-huxing">
            <div class="back" onclick="javascript:history.go(-1);"></div>
            <div class="title">户型简介</div>
        </div>
        <div class="content xlkm-content header-fix">
        </div>
        <div class="huxing-detail hidden">
            <div class="close"></div>
            <div class="pic"></div>
            <div class="text"></div>
        </div>
    </body>
    <script>
        $('.huxing-detail .close').click(function() {
            $('.huxing-detail').addClass('hidden');
        })
        function showDetail(pic) {
            //var pic = obj.attr('id');
            $('.huxing-detail .pic').css({"background-image":'url(detail/'+pic+')'});
            $('.huxing-detail').removeClass('hidden');
        }
        window.onload = function() {
            var jsonstr;
            jsonstr = '['+
                '{"title":"V系列 - “献给成功路上的时代新阶”的定制生活", '+
                '"item":['+
                    '{"picUrl":"http://wukuang.sh.v5read.com/house/12-icon.jpg?1414488260.51",'+
                    '"info":"三室两厅两卫", '+
                    '"type":"B户型", '+
                    '"area":"180-330"' +'}, '+
                   '{"picUrl":"http://wukuang.sh.v5read.com/house/6-icon.jpg?1414488260.52",'+
                    '"info":"三室两厅两卫", '+
                    '"type":"A户型", '+
                    '"area":"125"' +'}, '+
                    '{"picUrl":"http://wukuang.sh.v5read.com/house/9-icon.jpg?1414488260.53",'+
                    '"info":"三室两厅两卫", '+
                    '"type":"", '+
                    '"area":"140"' +'}] },'+
                '{"title":"X系列 - “空间乘法原理”室界的无限可能", '+
                '"item":['+
                    '{"picUrl":"http://wukuang.sh.v5read.com/house/5-icon.jpg?1414488260.49",'+
                    '"info":"三室两厅一卫", '+
                    '"type":"", '+
                    '"area":"90"' +'}, '+
                   '{"picUrl":"http://wukuang.sh.v5read.com/house/7-icon.jpg?1414488260.5",'+
                    '"info":"三室两厅一卫", '+
                    '"type":"", '+
                    '"area":"105"' +'}] },'+
                '{"title":"U系列——“向上族”向上的人生，up的生活", '+
                '"item":['+
                    '{"picUrl":"http://wukuang.sh.v5read.com/house/73-icon.jpg?1414488260.54",'+
                    '"info":"3+1室两厅两卫", '+
                    '"type":"B户型", '+
                    '"area":"95"' +'}, '+
                   '{"picUrl":"http://wukuang.sh.v5read.com/house/74-icon.jpg?1414488260.55",'+
                    '"info":"3+1室两厅两卫", '+
                    '"type":"", '+
                    '"area":"105"' +'},'+
                    '{"picUrl":"http://wukuang.sh.v5read.com/house/75-icon.jpg?1414488260.57",'+
                    '"info":"3+1室两厅两卫", '+
                    '"type":"A户型", '+
                    '"area":"95"' +'}] } ' 
            +']';
            var jsonList = jQuery.parseJSON(jsonstr);
            var obj = $('.xlkm-content');
            for (var i = 0; i < jsonList.length; i++) {
                var str = '<div class="huxing-item shadow">' +
                    '<div class="title">'+jsonList[i]["title"]+'</div>';
                var item = jsonList[i]["item"];
                    for (var j = 0; j < item.length; j++) {
                        str +=  '<div class="content" onclick="showDetail(\''+i+'-'+j+'.jpg\');">'+
                                    '<div class="pic" style="background-image:url('+item[j]["picUrl"]+')"></div>'+
                                    '<div class="detail-info">'+
                                        '<div class="info">'+item[j]["info"]+'</div>'+
                                        '<div class="type">'+item[j]["type"]+'</div>'+
                                        '<div class="size">建筑面积：约<span>'+item[j]["area"]+'</span>㎡</div> </div> </div>';
                    }
                    str += '</div>';
                var node = $(str);
                obj.append(node);
            }
        }
    </script>
</html>
